package be.ac.ua.codebase;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.UUID;

import net.jini.core.transaction.CannotJoinException;
import net.jini.core.transaction.UnknownTransactionException;
import net.jini.core.transaction.server.CrashCountException;
import net.jini.core.transaction.server.TransactionManager;
import net.jini.core.transaction.server.TransactionParticipant;

public interface BankAccountInterface extends Remote {
	public UUID getId() throws RemoteException;
	public double getAmount() throws RemoteException;
	public void credit(double amount) throws RemoteException;
	public void debit(double amount) throws RemoteException;
	public void credit(double amount, TransactionManager transactionManager, long transactionId) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException;
	public void debit(double amount, TransactionManager transactionManager, long transactionId) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException;
	public void abort(TransactionManager transactionManager, long transactionId) throws UnknownTransactionException, RemoteException;
	public void commit(TransactionManager transactionManager, long transactionId) throws UnknownTransactionException, RemoteException;
	public int prepare(TransactionManager transactionManager, long transactionId) throws UnknownTransactionException, RemoteException;
	public int prepareAndCommit(TransactionManager transactionManager, long transactionId) throws UnknownTransactionException, RemoteException;
}
